<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>spread operate</title>
</head>
<body>
  <div id="app"></div>
  <script type="text/javascript" src="../js/react.js"></script>
  <script type="text/javascript" src="../js/react-dom.js"></script>
  <script type="text/javascript" src="../babel/browser.js"></script>
  <script type="text/babel">
    var Fancylink = React.createClass({
      render: function() {
        switch(this.props.size) {
          case "medium": console.log(" aaaaaaaaaaa "); break;
          case "ok": console.log("bbbbbbbbbbbb"); break;
        }
        return <a {...this.props}>{this.props.children}</a>
      }
    });

    // 通过标签来引入react定义的类
    // 通过展开运算符，传递不确定的多个参数
    ReactDOM.render(
      <Fancylink href="http://www.baidu.com" target="_blank" style={ {color: "red"}} size="ok"> Hello baidu </Fancylink>,
      document.getElementById("app")
    )

  </script>
</body>
</html>
